"""
SimpleAPI ORM - 基于 Tortoise ORM 的简化数据库操作包

这个包提供了完全封装的 ORM 接口，用户无需了解 Tortoise ORM 的细节。

主要组件：
- Model: 模型基类
- fields: 字段类型
- Database: 数据库连接管理
- Query: 查询接口
- migrations: 数据库迁移
"""

from .fields import (
    # 基础字段
    IntField,
    CharField,
    TextField,
    BooleanField,
    FloatField,
    DecimalField,
    
    # 日期时间字段
    DateField,
    DateTimeField,
    TimeField,
    
    # 关系字段
    ForeignKeyField,
    OneToOneField,
    ManyToManyField,
    
    # 特殊字段
    JSONField,
    UUIDField,
    BinaryField,
    
    # 便捷函数
    primary_key,
    auto_uuid,
    created_at,
    updated_at,
    foreign_key,
    one_to_one,
    many_to_many,
)

from .models import Model, ModelMeta, BaseModel
from .database import Database, database, DatabaseConfig, with_database
from .query import QuerySet, Q, F, QueryBuilder, Aggregation
from .exceptions import (
    ORMError,
    DoesNotExist,
    MultipleObjectsReturned,
    IntegrityError,
    ValidationError,
    ConfigurationError,
    TransactionError,
    DatabaseError,
    ConnectionError,
)
from .migrations import (
    Migration,
    MigrationManager,
    migration_manager,
    create_tables,
    drop_tables,
    migrate,
    make_migration,
    save_migration,
)

# 版本信息
__version__ = "1.0.0"

# 导出所有公共接口
__all__ = [
    # 字段类型
    "IntField",
    "CharField", 
    "TextField",
    "BooleanField",
    "FloatField",
    "DecimalField",
    "DateField",
    "DateTimeField",
    "TimeField",
    "ForeignKeyField",
    "OneToOneField", 
    "ManyToManyField",
    "JSONField",
    "UUIDField",
    "BinaryField",
    
    # 便捷函数
    "primary_key",
    "auto_uuid", 
    "created_at",
    "updated_at",
    "foreign_key",
    "one_to_one",
    "many_to_many",
    
    # 模型
    "Model",
    "ModelMeta",
    "BaseModel",
    
    # 数据库
    "Database",
    "database",
    "DatabaseConfig",
    "with_database",
    
    # 查询
    "QuerySet",
    "Q",
    "F",
    "QueryBuilder",
    "Aggregation",
    
    # 异常
    "ORMError",
    "DoesNotExist",
    "MultipleObjectsReturned", 
    "IntegrityError",
    "ValidationError",
    "ConfigurationError",
    "TransactionError",
    "DatabaseError",
    "ConnectionError",
    
    # 迁移
    "Migration",
    "MigrationManager",
    "migration_manager",
    "create_tables",
    "drop_tables",
    "migrate",
    "make_migration",
    "save_migration",
] 